package cn.iot.sys.service.impl;

import cn.iot.common.dto.ResultMsg;
import cn.iot.sys.dao.SysTeacherDao;
import cn.iot.sys.entity.SysTeacher;
import cn.iot.sys.service.SysTeacherService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class SysTeacherServiceImpl implements SysTeacherService {
    @Resource
    private SysTeacherDao sysTeacherDao;
    private Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    public ResultMsg getSysTeacherList(Map<String,Object> map) {
        logger.info("SysTeacherServiceImpl getSysTeacherList start...");
        int isHeadmaster = Integer.parseInt((String) map.get("isHeadmaster"));
        map.remove("isHeadmaster");
        map.put("isHeadmaster",isHeadmaster);
        List<SysTeacher> sysTeacherList = sysTeacherDao.getSysTeacherList(map);
        ResultMsg msg = new ResultMsg(200,"成功",sysTeacherList);
        return msg;
    }
}
